# class GoGamer(object):
#     __field = 'go'
#
#
# class ChineseGoGamer(GoGamer):
#     __nation = 'cn'
#
#     def __init__(self, rank):
#         self.__rank = rank
#
#     @classmethod
#     def get_nation(cls):
#         return cls.__nation
#
#     def weibo(self, msg):
#         return f"微博：{msg}"
#
#
# kejie = ChineseGoGamer(9)
# # print(kejie._ChineseGoGamer__rank)
# # print(ChineseGoGamer._ChineseGoGamer__nation)
# print(ChineseGoGamer.get_nation())
# print(kejie.weibo("又夺冠了"))
#
#
# class Math:
#     def add(self, x, y):
#         return x + y
#
#
# class MyMath:
#     @staticmethod
#     def add(x, y):
#         return x + y
#
#
# math = Math()
# print(math.add(1, 2))
# print(MyMath.add(1, 2))
#
#
# import abc
#
#
# class Test:
#     @abc.abstractmethod
#     def test(self):
#         pass

from math import sqrt


class MyMath:
    def __init__(self):
        pass

    @staticmethod
    def add_func(self, *args):
        answer = 0
        print(args)
        for i in args:
            print(i)
            answer += args[i]
        return answer

    @staticmethod
    def sub_func(self, *args):
        answer = 0
        print(args)
        for i in args:
            print(i)
            answer -= args[i]
        return answer

    @staticmethod
    def mul_func(self, *args):
        answer = 1
        print(args)
        for i in args:
            print(i)
            answer *= args[i]
        return answer

    @staticmethod
    def div_func(self, *args):
        answer = args[0]
        print(args)
        for i in args[1:]:
            print(i)
            answer /= args[i]
        return answer

    @staticmethod
    def power_func(self, *args):
        answer = []
        print(args)
        for i in args:
            print(i)
            answer.append(i**2)
        return answer

    @staticmethod
    def spu_func(self, *args):
        answer = []
        print(args)
        for i in args:
            print(i)
            answer.append(sqrt(i))
        return answer


class CompanyProduct:
    industry = 'IT'
    __product = 'IPC'

    def __init__(self, company, ic, date, uni):
        self.CompanyName = company
        self.ICName = ic
        self.Date = date
        self.__UniName = uni

    def __str__(self):
        return f"公司名称：{self.CompanyName}; IC型号：{self.ICName}; 项目开始时间：{self.Date}; 项目唯一代称：{self.__UniName}"

    @classmethod
    def get_product(cls):
        print(f"产品形式：{cls.__product}")
        return cls.__product

    def company_name(self):
        print(f"公司名称：{self.CompanyName}")

    def ic_name(self):
        print(f"IC型号：{self.ICName}")

    def date_time(self):
        print(f"项目开始时间：{self.Date}")

    def uni_id(self):
        print(f"项目唯一代称：{self.__UniName}")


if __name__ == '__main__':
    pro = CompanyProduct('Hisilicon', 'Hi3518', '20201118', 'C1A')
    pro.company_name()
    pro.ic_name()
    pro.date_time()
    pro.get_product()
    pro.uni_id()
    print(pro.__str__())
    print(MyMath.add_func(1, 1, 1))
    print(MyMath.sub_func(1, 1, 1))
    print(MyMath.mul_func(1, 1, 1))
    print(MyMath.div_func(3, 1, 1))
    print(MyMath.power_func(3, 1, 1))
    print(MyMath.spu_func(3, 1, 1))




